export default {
    namespaced: true,
    state: {
        token: uni.getStorageSync('token'),
        authShow: false,
        wxcode: '',
        userInfo: {},
        bindAgentId: uni.getStorageSync('bindAgentId'),
    },
    mutations: {
        setToken(state, token) {
            state.token = token
            uni.setStorageSync('token', token)
        },
        setAuth(state, authShow) {
            state.authShow = authShow
            uni.setStorageSync('auth', authShow)
        },
        setWxcode(state, wxcode) {
            state.wxcode = wxcode
            uni.setStorageSync('wxcode', wxcode)
        },
        setUserInfo(state, user) {
            state.userInfo = user
            uni.setStorageSync('user_info', user)
        },
        setBindAgentId(state, bindAgentId) {
            state.bindAgentId = bindAgentId
            uni.setStorageSync('bindAgentId', bindAgentId)
        },
    },
}
